package com.rui.cn.entity.system;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 菜单
 * </p>
 *
 * @author zhang123
 * @since 2018-01-15
 */
@TableName("sys_menu")
public class SysMenu extends Model<SysMenu> implements Serializable{

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 父级id
     */
    private Integer parentid;
    /**
     * 父级菜单名称
     */
    @TableField(exist = false)
    private String parentName;
    /**
     * 菜单名称
     */
    private String title;
    /**
     * 图标
     */
    private String icon;
    /**
     * 链接
     */
    private String href;
    /**
     * 是否展开（true false）
     */
    private String spread;
    /**
     * 排序
     */
    private Integer flag;
    /**
     * 状态(1启用 0禁用)
     */
    private Integer state;
    /**
     * 描述
     */
    private String description;
    @TableField(exist = false)
    List<SysMenu> children;

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public List<SysMenu> getChildren() {
        return children;
    }

    public void setChildren(List<SysMenu> children) {
        this.children = children;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParentid() {
        return parentid;
    }

    public void setParentid(Integer parentid) {
        this.parentid = parentid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getSpread() {
        return spread;
    }

    public void setSpread(String spread) {
        this.spread = spread;
    }

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysMenu{" +
        "id=" + id +
        ", parentid=" + parentid +
        ", title=" + title +
        ", icon=" + icon +
        ", href=" + href +
        ", spread=" + spread +
        ", flag=" + flag +
        ", state=" + state +
        ", description=" + description +
        "}";
    }

}
